import java.util.HashMap;
import java.util.Scanner;

public class MC0419不同子串 {
    public static void main(String[] args) {

        Scanner input = new Scanner(System.in);
        // code here
        String s = input.nextLine();
        HashMap<String, Boolean> map = new HashMap<>();
        int n = s.length(), ans = 0;
        for (int i = 0; i < n; i++) {
            for (int j = i; j < n; j++) {
                String t = s.substring(i, j + 1);
                if (!map.containsKey(t)) {
                    map.put(t, true);
                    ans++;
                }
            }
        }
        System.out.println(ans);
        input.close();
    }
}
